import Url from '@/common/http/url.js'
import store from '@/store/index.js'
// import Tools from '@/utils/Tools.js'
import { CLIENT, BASE_DOMAIN, VERSION_CODE, PLAT } from '@/constant/Config.js';
console.log(VERSION_CODE, PLAT)
// 13665032546
const install = (Vue, vm) => {
	const textApi = () => vm.$u.post(Url.API_TEST, {
		public: 1,
		_target: 'common'
	})

	const init = () => vm.$u.post(Url.INIT, {
		auth: '',
		plat: PLAT,
		ver_in: VERSION_CODE

	})
	const getPageInfo = (page_id = '') => vm.$u.get(Url.GET_PAGE_INFO, {
		auth: ''
	})
	const getPaymentList = (source = '') => vm.$u.get(Url.PAYMENT_LIST, {
		auth: '',
		source
		// recharge-充值#order-订单#vip-套餐#gift-礼物
	})
	const getRandNickname = (getRandNickname) => vm.$u.get(Url.RAND_NICKNAME, {
		auth: ''
	})

	const getGoodsInfo = (goods_id = '') => vm.$u.get(Url.GET_GOODS_INFO, {
		auth: '',
		goods_id
	})
	const getGoodsList = (param = {}) => vm.$u.get(Url.GET_GOODS_LIST, {
		auth: '',
		...param
	})
	const getGoodsPoster = (goods_id = '') => vm.$u.get(Url.GET_GOODS_POST, {
		auth: '',
		goods_id
	})
	const getGoodsCategory = () => vm.$u.get(Url.GET_GOODS_CATEGORY, {
		auth: ''
	})
	const getSharingSetting = () => vm.$u.get(Url.GET_SHARING_SETTING, {
		auth: ''
	})
	const getSharingGoodsInfo = (goods_id) => vm.$u.get(Url.GET_SHARING_GOODS_INFO, {
		auth: '',
		goods_id
	})

	const getSharingGoodsPoster = (goods_id) => vm.$u.get(Url.GET_SHARING_GOODS_POSTER, {
		auth: '',
		goods_id
	})

	const getArticleCate = () => vm.$u.get(Url.GET_ARTICLE_CATE, {
		auth: '',
	})
	const getArticleList = (param) => vm.$u.get(Url.GET_ARTICLE_LIST, {
		auth: '',
		...param
	})
	const getArticleInfo = (article_id) => vm.$u.get(Url.GET_ARTICLE_INFO, {
		auth: '',
		article_id
	})

	const sendSmsCode = (mobile, scene = 'login') => vm.$u.post(Url.SEND_SMS_CODE, {
		auth: '',
		mobile,
		scene
	})
	const loginBySms = (mobile, verify, third_id = '', referee_code = '') => vm.$u.post(Url.LOGIN_BY_SMS, {
		auth: '',
		mobile,
		verify,
		third_id,
		referee_code,
		identity: '',
		login_type: CLIENT
	})

	const loginByPassword = (mobile, password, third_id = '') => vm.$u.post(Url.LOGIN_BY_PASSWORD, {
		auth: '',
		mobile,
		password,
		login_type: CLIENT
	})

	const loginByWechat = (code, referee_code = '') => vm.$u.post(Url.WECHAT_LOGIN, {
		auth: '',
		code,
		referee_code,
	})

	const linkWechatLogin = (redirect) => {
		location.href = `${Url.LINK_WECHAT_LOGIN}?url=${Url.HTML_DOMAIN}${redirect}`
	}
	const loginByAuthId = (id, referee_code = '') => vm.$u.post(Url.LOGIN_BY_AUTH_ID, {
		auth: '',
		id,
		referee_code,
		login_type: CLIENT
	})

	const getUserBase = (lnglat_update = 0) => vm.$u.post(Url.GET_USER_BASE, {
		auth: 'token',
		lnglat_update

	})
	const loginByWxapp = (code, iv, encryptedData, referee_code = '') => vm.$u.post(Url.LOGIN_BY_WXAPP, {
		auth: '',
		code,
		iv,
		encryptedData,
		referee_code
	})
	const getThirdBindList = () => vm.$u.post(Url.GET_THIRD_BIND_LIST, {
		auth: 'token',
	})
	const unbindThirdAuth = (bind_type) => vm.$u.post(Url.UNBIND_THIRD_AUTH, {
		auth: 'token',
		bind_type
	})

	const getCartList = () => vm.$u.post(Url.GET_CART_LIST, {
		auth: 'token',
	})
	const addCart = (goods_id, goods_num, spec_sku_id) => vm.$u.post(Url.ADD_CART, {
		auth: 'token',
		goods_id,
		goods_num,
		spec_sku_id
	})
	const subCart = (goods_id, spec_sku_id) => vm.$u.post(Url.SUB_CART, {
		auth: 'token',
		goods_id,
		spec_sku_id
	})
	const delCart = (cart_ids) => vm.$u.post(Url.DEL_CART, {
		auth: 'token',
		cart_ids
	})
	const getAddressList = () => vm.$u.post(Url.GET_ADDRESS_LIST, {
		auth: 'token'
	})
	const delAddress = (address_id) => vm.$u.post(Url.DEL_ADDRESS, {
		auth: 'token',
		address_id
	})
	const getRegionList = () => vm.$u.post(Url.GET_REGION_LIST, {
		auth: ''
	})

	const addAddress = (obj) => vm.$u.post(Url.ADD_ADDRESS, {
		auth: 'token',
		...obj
	})

	const editAddress = (obj) => vm.$u.post(Url.EDIT_ADDRESS, {
		auth: 'token',
		...obj
	})
	const getAddressDetail = (address_id) => vm.$u.post(Url.GET_ADDRESS_DETAIL, {
		auth: 'token',
		address_id
	})

	const setDefaultAddress = (address_id) => vm.$u.post(Url.SET_DEFAULT_ADDRESS, {
		auth: 'token',
		address_id
	})
	const getOrderDataForBuyNow = (obj) => vm.$u.get(Url.BUY_NOW, {
		auth: 'token',
		...obj
	})

	const submitOrderForBuyNow = (obj) => vm.$u.post(Url.BUY_NOW, {
		auth: 'token',
		...obj
	})
	const getOrderDataForCartBuy = (obj) => vm.$u.get(Url.CART_BUY, {
		auth: 'token',
		...obj
	})

	const submitOrderForCartBuy = (obj) => vm.$u.post(Url.CART_BUY, {
		auth: 'token',
		...obj
	})
	const payOrder = (obj) => vm.$u.post(Url.PAY_ORDER, {
		auth: 'token',
		...obj
	})
	const getOrderList = (page, dataType) => vm.$u.post(Url.GET_ORDER_LIST, {
		auth: 'token',
		page,
		dataType
	})
	const cancelOrder = (order_id) => vm.$u.post(Url.CANCEL_ORDER, {
		auth: 'token',
		order_id
	})
	const getOrderDetail = (order_id) => vm.$u.post(Url.GET_ORDER_DETAIL, {
		auth: 'token',
		order_id
	})
	const receiptOrder = (order_id) => vm.$u.post(Url.RECEIPT_ORDER, {
		auth: 'token',
		order_id
	})
	const getOrderQrcode = (order_id) => vm.$u.post(Url.GET_ORDER_QRCODE, {
		auth: 'token',
		order_id
	})
	const getShopList = (longitude, latitude) => vm.$u.get(Url.GET_SHOP_LIST, {
		auth: 'token',
		longitude,
		latitude
	})

	const getOrderExpress = (order_id) => vm.$u.get(Url.ORDER_EXPRESS, {
		auth: 'token',
		order_id
	})

	const getOrderCommentList = (order_id) => vm.$u.get(Url.ORDER_COMMENT, {
		auth: 'token',
		order_id
	})
	const submitOrderCommentData = (order_id, formData) => vm.$u.post(Url.ORDER_COMMENT, {
		auth: 'token',
		order_id,
		formData
	})

	const getGoodsComment = (goods_id, page, scoreType = -1) => vm.$u.post(Url.GOODS_COMMENT, {
		auth: 'token',
		goods_id,
		page,
		scoreType
	})

	const getRefundData = (order_goods_id) => vm.$u.get(Url.REFUND_APPLY, {
		auth: 'token',
		order_goods_id
	})
	const saveRefundApply = (data) => vm.$u.post(Url.REFUND_APPLY, {
		auth: 'token',
		...data
	})

	const getRefundList = (page, state = -1) => vm.$u.get(Url.REFUND_LIST, {
		auth: 'token',
		page,
		state
	})

	const getRefundDetail = (order_refund_id) => vm.$u.get(Url.REFUND_DETAIL, {
		auth: 'token',
		order_refund_id
	})
	const saveRefundDelivery = (obj) => vm.$u.post(Url.REFUND_DELIVERY, {
		auth: 'token',
		...obj
	})
	const submitRealNameCartication = (idcard, real_name, verify = '') => vm.$u.post(Url.REAL_NAME_CERTICATION, {
		auth: 'token',
		idcard,
		real_name,
		verify
	})
	const getRechargeCenter = () => vm.$u.get(Url.RECHARGE_CENTER, {
		auth: 'token',
	})
	const getUserBasic = () => vm.$u.get(Url.USER_BASIC, {
		auth: 'token',
	})
	const saveUserBasic = (param) => vm.$u.post(Url.USER_BASIC, {
		auth: 'token',
		...param
	})
	const uploadImage = (filePath, formData, name = 'iFile') => vm.$u.uploadFile(Url.UPLOAD_IMAGE, {
		auth: 'token',
		filePath,
		formData,
		name
	})

	const uploadVideo = (filePath, formData, name = 'iFile') => vm.$u.uploadFile(Url.UPLOAD_VIDEO, {
		auth: 'token',
		filePath,
		formData,
		name
	})
	const uploadAudio = (filePath, formData, name = 'iFile') => vm.$u.uploadFile(Url.UPLOAD_AUDIO, {
		auth: 'token',
		filePath,
		formData,
		name
	})


	const doRecharge = (planId, customMoney, payType, return_url) => vm.$u.post(Url.USER_RECHARGE, {
		auth: 'token',
		planId,
		customMoney,
		payType,
		return_url
	})
	const getUserCoupData = () => vm.$u.get(Url.USER_COUP, {
		auth: 'token',
	})
	const saveUserCoupData = (param) => vm.$u.post(Url.USER_COUP, {
		auth: 'token',
		...param
	})

	const getUserDataGroup = (group_id = 0) => vm.$u.get(Url.USER_DATA_GROUP, {
		auth: 'token',
		group_id
	})

	const saveUserDataGroup = (group_id = 0, group) => vm.$u.post(Url.USER_DATA_GROUP, {
		auth: 'token',
		group_id,
		group
	})

	const getUserData = () => vm.$u.get(Url.USER_DATA, {
		auth: 'token',
	})

	const getUserSignDate = () => vm.$u.get(Url.USER_SIGN_DATA, {
		auth: 'token',
	})

	const searchParamItem = (keyname, keyword = '', page = 1) => vm.$u.get(Url.SEARCH_PARAM_ITEM, {
		auth: '',
		keyname,
		keyword,
		page
	})

	const doSignIn = () => vm.$u.get(Url.USER_SIGN_IN, {
		auth: '',

	})
	const getRechargeOrder = (page = 1) => vm.$u.get(Url.RECHARGE_ORDER, {
		auth: '',
		page

	})
	const getBalanceLog = (page = 1) => vm.$u.get(Url.BALANCE_LOG, {
		auth: '',
		page
	})
	const logout = () => vm.$u.get(Url.USER_LOGOUT, {
		auth: '',

	})
	const updateLngLat = (lng, lat) => vm.$u.get(Url.USER_LNG_LAT, {
		auth: '',
		lng,
		lat
	})

	const getCoupCardList = (page = 1) => vm.$u.get(Url.COUP_CARD_LIST, {
		auth: 'token',
		page
	})


	/* 对异性的特殊行为
	 *
	 * @param {String} to_user - 用户id，逗号隔开
	 * @param {Number} master - 行为枚举(10-关注#20-拉黑#30-喜欢#40-不喜欢)
	 * 
	 * @return {Promise} promise对象
	 */

	const doHehaviorToSex = (to_user, master) => vm.$u.get(Url.BEHAVIOR_TO_SEX, {
		auth: 'token',
		to_user,
		master
	})

	const publishMoment = (param) => vm.$u.post(Url.MOMENT_PUBLISH, {
		auth: 'token',
		...param
	})
	const getMomentList = (page = 1, to_user = 0) => vm.$u.post(Url.MOMENT_LIST, {
		auth: 'token',
		page,
		to_user
	})
	const addAlbumPhoto = (file_id) => vm.$u.post(Url.ALBUM_PHOTO_ADDITION, {
		auth: 'token',
		file_id
	})

	const getAlbumPhoto = (page = 1) => vm.$u.post(Url.ALBUM_PHOTO_ALL, {
		auth: 'token',
		page
	})

	const deleteAlbumPhoto = (album_ids) => vm.$u.post(Url.ALBUM_PHOTO_DELETE, {
		auth: 'token',
		album_ids
	})
	const getMomentLines = (page) => vm.$u.get(Url.MOMENT_LINES, {
		auth: 'token',
		page
	})
	const getMomentNearby = (page) => vm.$u.get(Url.MOMENT_NEARBY, {
		auth: 'token',
		page
	})

	const doFavorToMoment = (moment_id) => vm.$u.post(Url.MOMENT_DO_FAVOR, {
		auth: 'token',
		moment_id
	})

	const doCommentToMoment = (moment_id, content, comment_id = 0) => vm.$u.post(Url.MOMENT_DO_COMMENT, {
		auth: 'token',
		moment_id,
		content,
		comment_id
	})


	const getMomentDetail = (moment_id) => vm.$u.post(Url.MOMENT_DETAIL, {
		auth: 'token',
		moment_id
	})
	const getMomentCommentList = (moment_id, page = 1) => vm.$u.post(Url.MOMENT_COMMENT_LIST, {
		auth: 'token',
		moment_id,
		page
	})

	const getMomentFavorList = (moment_id, limit = 34) => vm.$u.get(Url.MOMENT_FAVOR_LIST, {
		auth: 'token',
		moment_id,
		limit
	})

	const getVipCenter = () => vm.$u.get(Url.VIP_CENTER, {
		auth: 'token',

	})
	const buyVip = (planId, payType) => vm.$u.post(Url.VIP_PURCHASE, {
		auth: 'token',
		planId,
		payType
	})

	const getOtherUserDetail = (user_id) => vm.$u.get(Url.OTHER_USER_DETAIL, {
		auth: 'token',
		user_id
	})

	const getOtherUserPhoto = (page, to_user) => vm.$u.get(Url.OTHER_USER_PHOTO, {
		auth: 'token',
		page,
		to_user
	})
	const getGiftCabinetList = (page, to_user) => vm.$u.get(Url.GIFT_CABINET_LIST, {
		auth: 'token',
		page,
		to_user
	})
	const giveGiftsToUser = (gift_id, to_user, num = 1, payType = 10) => vm.$u.post(Url.GIFT_BUY, {
		auth: 'token',
		gift_id,
		to_user,
		num,
		payType
	})
	const getGiftReceiveList = (to_user = 0, page = 1) => vm.$u.get(Url.GIFT_RECEIVE_LIST, {
		auth: 'token',
		page,
		to_user
	})

	const getUserQRCode = () => vm.$u.get(Url.USER_QRCODE, {
		auth: 'token'

	})
	const saveAccountPassword = (mobile, verify, password, repassword) => vm.$u.post(Url.ACCOUNT_PASSWORD, {
		auth: 'token',
		mobile,
		verify,
		password,
		repassword,

	})

	const getScopeSetting = () => vm.$u.get(Url.SCOPE_SETTING, {
		auth: 'token'
	})

	const saveScopeSetting = (param = {}) => vm.$u.post(Url.SCOPE_SETTING, {
		auth: 'token',
		...param
	})

	const getPointsGoodsList = (page = 1) => vm.$u.get(Url.POINTS_GOODS_LIST, {
		auth: 'token',
		page
	})
	const getPointsGoodsInfo = (goods_id = 0) => vm.$u.get(Url.POINTS_GOODS_INFO, {
		auth: 'token',
		goods_id
	})
	const getCupidInfo = (goods_id = 0) => vm.$u.get(Url.CUPID_INFO, {
		auth: 'token'
	})
	const submitCupidApply = (param = {}) => vm.$u.post(Url.CUPID_APPLY, {
		auth: 'token',
		...param
	})

	const getAgreementData = (key = '') => vm.$u.post(Url.AGREEMENT, {
		auth: 'token',
		key
	})

	const openAgreementPage = (key = '') => {
		return Url.AGREEMENT + '?key=' + key
	}

	const sendChatSingleMessage = (nonce_str, content, to_id) => vm.$u.post(Url.CHAT_SINGLE_MESSAGE_SEND, {
		auth: 'token',
		nonce_str,
		content,
		to_id
	})
	const sendChatGroupMessage = (nonce_str, content, group_id) => vm.$u.post(Url.CHAT_GROUP_MESSAGE_SEND, {
		auth: 'token',
		nonce_str,
		content,
		group_id
	})

	const getPointsGoodsCheckout = (param) => vm.$u.get(Url.POINTS_GOODS_CHECKOUT, {
		auth: 'token',
		...param
	})

	const postPointsGoodsCheckout = (param) => vm.$u.post(Url.POINTS_GOODS_CHECKOUT, {
		auth: 'token',
		...param
	})

	const getPointsOrderInfo = (order_id) => vm.$u.get(Url.POINTS_ORDER_INFO, {
		auth: 'token',
		order_id
	})

	const receiptPointsOrder = (order_id) => vm.$u.post(Url.RECEIPT_POINTS_ORDER, {
		auth: 'token',
		order_id
	})

	const getPointsOrderList = (page = 1, dataType = 'all') => vm.$u.post(Url.POINTS_ORDER_LIST, {
		auth: 'token',
		page,
		dataType
	})

	const getSingleChatSessionList = (page = 1) => vm.$u.post(Url.SINGLE_CHAT_SESSION_LIST, {
		auth: 'token',
		page
	})

	const setChatSessionRead = (chat_user) => vm.$u.post(Url.CHAT_SESSION_READ, {
		auth: 'token',
		chat_user
	})


	const deleteChatSessionItem = (notice_id) => vm.$u.post(Url.CHAT_SESSION_DEL, {
		auth: 'token',
		notice_id
	})

	const inBlackList = (to_id) => vm.$u.post(Url.USER_IN_BLACK_LIST, {
		auth: 'token',
		to_id
	})
	const outBlackList = (to_id) => vm.$u.post(Url.USER_OUT_BLACK_LIST, {
		auth: 'token',
		to_id
	})

	const getMyCupid = () => vm.$u.get(Url.MY_CUPID, {
		auth: 'token'
	})

	const getBlackList = (page = 1) => vm.$u.get(Url.BLACK_LIST, {
		auth: 'token',
		page
	})
	const getOfficialNoticeHome = () => vm.$u.get(Url.OFFICIAL_NOTICE_HOME, {
		auth: 'token',
	})

	const getOfficialNoticeList = (type, page = 1) => vm.$u.get(Url.OFFICIAL_NOTICE_LIST, {
		auth: 'token',
		type,
		page
	})

	const getSingleChatLog = (to_id, page = 1, page_size = 10) => vm.$u.get(Url.SINGLE_CHAT_LOG, {
		auth: 'token',
		to_id,
		page,
		page_size
	})
	const getGroupChatLog = (group_id, page = 1, page_size = 10) => vm.$u.get(Url.GROUP_CHAT_LOG, {
		auth: 'token',
		group_id,
		page,
		page_size
	})


	const postBindCupid = (code) => vm.$u.post(Url.BIND_CUPID, {
		auth: 'token',
		code
	})

	const getGroupChatSessionList = (page, page_size) => vm.$u.get(Url.GROUP_CHAT_SESSION_LIST, {
		auth: 'token',
		page,
		page_size
	})

	const getSingleList = (page, gender = 0) => vm.$u.get(Url.SINGLE_LIST, {
		auth: 'token',
		page,
		gender
	})

	const pullInGroup = (to_ids) => vm.$u.post(Url.PULL_IN_GROUP, {
		auth: 'token',
		to_ids
	})
	const getGroupDetail = (group_id) => vm.$u.get(Url.GROUP_DETAIL, {
		auth: 'token',
		group_id
	})
	const getDealerTeamList = (level, page = 1) => vm.$u.get(Url.DEALER_TEAM_LIST, {
		auth: 'token',
		level,
		page
	})
	const getUserFans = (page = 1) => vm.$u.get(Url.USER_FANS, {
		auth: 'token',
		page
	})
	const getUserFavors = (page = 1) => vm.$u.get(Url.USER_FAVORS, {
		auth: 'token',
		page
	})

	const getUserIdentity = (user_id = null) => vm.$u.get(Url.USER_IDENTITY, {
		auth: 'token',
		user_id
	})
	const updateLocation = () => vm.$u.post(Url.AUTO_LOCATION, {
		auth: 'token',
	})
	const checkToken = () => vm.$u.post(Url.CHECK_TOKEN, {
		auth: 'token',
	})

	const getComplaintParam = (object = 10) => vm.$u.get(Url.COMPLAINT, {
		auth: 'token',
		object
	})
	const submitComplaintParam = (type_id, content = '', object_id = 0) => vm.$u.post(Url.COMPLAINT, {
		auth: 'token',
		type_id,
		content,
		object_id
	})

	const getDealerCenter = () => vm.$u.get(Url.DEALER_CENTER, {
		auth: 'token',

	})

	const getDealerOrderList = (settled, page = 1) => vm.$u.get(Url.DEALER_ORDER_LIST, {
		auth: 'token',
		settled,
		page

	})


	const getWithdrawParamInDealer = () => vm.$u.get(Url.WITHDRAW_IN_DEALER, {
		auth: 'token',
	})

	const submitWithdrawParamInDealer = (data = {}) => vm.$u.post(Url.WITHDRAW_IN_DEALER, {
		auth: 'token',
		data
	})

	const getShareInfo = (object_type, object_id, object_url) => vm.$u.post(Url.SHARE_INFO, {
		auth: 'token',
		object_type,
		object_id,
		object_url,
	})
	const getGiftGivesList = (page = 1) => vm.$u.get(Url.GIFT_GIVES_LIST, {
		auth: 'token',
		page
	})
	const getGiftCenter = () => vm.$u.get(Url.GIFT_CENTER, {
		auth: 'token',

	})

	const submitGiftSettle = () => vm.$u.get(Url.GIFT_SETTLE, {
		auth: 'token',
	})
	const getPointsLog = (page) => vm.$u.get(Url.POINTS_LOG, {
		auth: 'token',
		page
	})

	const getWithdrawList = (status, page) => vm.$u.get(Url.WITHDRAW_LIST, {
		auth: 'token',
		status,
		page
	})

	const setNoticeRead = (type, notice_id = 0) => vm.$u.get(Url.NOTICE_READ, {
		auth: 'token',
		notice_id,
		type
	})


	const getWithdrawSetting = () => vm.$u.get(Url.WITHDRAW_SETTING, {
		auth: 'token',

	})

	const applyWithdrawSubmit = (data) => vm.$u.get(Url.WITHDRAW_SUBMIT, {
		auth: 'token',
		data

	})

	const switchIdentity = (data) => vm.$u.post(Url.SWITCH_IDENTITY, {
		auth: 'token',
	})

	const submitErrorConsole = (error, path = "app.js", error_desc = "全局拦截错误") => vm.$u.post(Url.ERROR_CONSOLE, {
		error_smeta: JSON.stringify({ error }),
		error_desc,
		user_id: store.state.user.info ? store.state.user.info.user_id : '',
		path: path || 'app.js',
		sys: uni.getSystemInfoSync().system,
		plat: CLIENT
	})
	const delMoment = (moment_id) => vm.$u.post(Url.DEL_MOMENT, {
		auth: 'token',
		moment_id
	})

	const helloList = (page) => vm.$u.get(Url.HELLO_LIST, {
		auth: 'token',
		page
	})
	const readHello = (ids = -1) => vm.$u.get(Url.HELLO_READ, {
		auth: 'token',
		ids
	})

	const getDouyinVideoList = (page = 1, page_size = 100) => vm.$u.get(Url.DOUYIN_VIDEO_LIST, {
		auth: 'token',
		page,
		page_size
	})
	const setFirstIdentity = (identity = 10) => vm.$u.post(Url.FIRST_IDENTITY, {
		auth: 'token',
		identity
	})


	const getSuiCoinLog = (page = 1) => vm.$u.post(Url.SUI_COIN, {
		auth: 'token',
		page
	})

	const getVipOrder = (page = 1) => vm.$u.post(Url.VIP_ORDER, {
		auth: 'token',
		page
	})
	const doRevokeMsg = (nonce_str) => vm.$u.post(Url.REVOKE_MSG, {
		auth: 'token',
		nonce_str
	})


	// #ifdef APP-PLUS
	const submitClientId = (client_id = null) => vm.$u.post(Url.CLIENT_ID, {
		auth: 'token',
		client_id
	})
	// #endif

	// #ifdef H5
	const getWechatConfig = (now_url) => vm.$u.post(Url.WECHAT_CONFIG, {
		auth: 'token',
		now_url
	})
	// #endif



	vm.$u.api = {
		textApi,
		init,
		getRandNickname,
		getPageInfo,
		getGoodsInfo,
		getGoodsList,
		getGoodsPoster,
		getGoodsCategory,
		getSharingSetting,
		getSharingGoodsInfo,
		getSharingGoodsPoster,
		getArticleCate,
		getArticleList,
		getArticleInfo,
		sendSmsCode,
		loginBySms,
		loginByPassword,
		loginByWechat,
		linkWechatLogin,
		loginByAuthId,
		getUserBase,
		loginByWxapp,
		getThirdBindList,
		unbindThirdAuth,
		getCartList,
		addCart,
		subCart,
		delCart,
		getAddressList,
		delAddress,
		getRegionList,
		addAddress,
		getAddressDetail,
		editAddress,
		setDefaultAddress,
		getOrderDataForBuyNow,
		submitOrderForBuyNow,
		payOrder,
		getOrderList,
		getOrderDataForCartBuy,
		submitOrderForCartBuy,
		cancelOrder,
		getOrderDetail,
		receiptOrder,
		getOrderQrcode,
		getShopList,
		getOrderExpress,
		getOrderCommentList,
		submitOrderCommentData,
		getGoodsComment,
		getRefundData,
		saveRefundApply,
		getRefundList,
		getRefundDetail,
		saveRefundDelivery,
		submitRealNameCartication,
		getRechargeCenter,
		uploadImage,
		uploadVideo,
		uploadAudio,
		getUserBasic,
		saveUserBasic,
		doRecharge,
		getUserCoupData,
		getUserDataGroup,
		getUserData,
		saveUserCoupData,
		saveUserDataGroup,
		getUserSignDate,
		searchParamItem,
		doSignIn,
		getPaymentList,
		getRechargeOrder,
		getBalanceLog,
		logout,
		updateLngLat,
		getCoupCardList,
		doHehaviorToSex,
		publishMoment,
		getMomentList,
		addAlbumPhoto,
		getAlbumPhoto,
		deleteAlbumPhoto,
		getMomentLines,
		getMomentNearby,
		doFavorToMoment,
		getMomentDetail,
		getMomentCommentList,
		doCommentToMoment,
		getMomentFavorList,
		getVipCenter,
		buyVip,
		getOtherUserDetail,
		getOtherUserPhoto,
		getGiftCabinetList,
		giveGiftsToUser,
		getGiftReceiveList,
		getUserQRCode,
		saveAccountPassword,
		getScopeSetting,
		saveScopeSetting,
		getPointsGoodsList,
		getPointsGoodsInfo,
		getCupidInfo,
		submitCupidApply,
		getAgreementData,
		openAgreementPage,
		sendChatSingleMessage,
		sendChatGroupMessage,
		getPointsGoodsCheckout,
		postPointsGoodsCheckout,
		getPointsOrderInfo,
		receiptPointsOrder,
		getPointsOrderList,
		getSingleChatSessionList,
		setChatSessionRead,
		deleteChatSessionItem,
		inBlackList,
		outBlackList,
		getMyCupid,
		getBlackList,
		getOfficialNoticeHome,
		getOfficialNoticeList,
		getSingleChatLog,
		getGroupChatLog,
		postBindCupid,
		getGroupChatSessionList,
		getSingleList,
		pullInGroup,
		getGroupDetail,
		getDealerTeamList,
		getUserFans,
		getUserFavors,
		getUserIdentity,
		updateLocation,
		checkToken,
		getComplaintParam,
		submitComplaintParam,
		getDealerCenter,
		getDealerOrderList,
		getWithdrawParamInDealer,
		submitWithdrawParamInDealer,
		getShareInfo,
		getGiftGivesList,
		getGiftCenter,
		submitGiftSettle,
		getPointsLog,
		getWithdrawList,
		setNoticeRead,
		getWithdrawSetting,
		applyWithdrawSubmit,
		switchIdentity,
		submitErrorConsole,
		delMoment,
		helloList,
		readHello,
		getDouyinVideoList,
		setFirstIdentity,
		getSuiCoinLog,
		getVipOrder,
		doRevokeMsg,
		// #ifdef APP-PLUS
		submitClientId,
		// #endif
		// #ifdef H5
		getWechatConfig,
		// #endif

	};
}


export default {
	install
}
